package com.cat.model.web.action.api;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import com.cat.model.biz.service.api.IndexService;
import com.cat.model.common.util.ErrorCode;
import com.cat.model.web.action.base.BaseAction;

public class IndexAction extends BaseAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = -402297982171388221L;
	
	private String cityCode;
	private Integer page;
	private Integer size;
	@Autowired
	private IndexService indexApiService;
	
	/**
	 * 首页广告
	 */
	public void bannerList(){
		if(StringUtils.isEmpty(cityCode)){
			print(ErrorCode.PARAM_ERROR.response());
			return;
		}
		print(indexApiService.bannerList(cityCode));
	}
	
	/**
	 * 首页模特推荐
	 */
	public void indexRecomList(){
		if(StringUtils.isEmpty(cityCode)){
			print(ErrorCode.PARAM_ERROR.response());
			return;
		}
		print(indexApiService.indexRecomList(cityCode));
	}
	
	/**
	 * 首页即将到达模特
	 */
	public void indexSoonArriveList(){
		if(StringUtils.isEmpty(cityCode) || page==null || size==null){
			print(ErrorCode.PARAM_ERROR.response());
			return;
		}
		print(indexApiService.indexSoonArriveList(cityCode,page,size));
	}
	
	/**
	 * 获取联系我们
	 * */
	public void contactInfo(){
		
		print(indexApiService.contactInfo());
	}

	public String getCityCode() {
		return cityCode;
	}

	public void setCityCode(String cityCode) {
		this.cityCode = cityCode;
	}

	public Integer getPage() {
		return page;
	}

	public void setPage(Integer page) {
		this.page = page;
	}

	public Integer getSize() {
		return size;
	}

	public void setSize(Integer size) {
		this.size = size;
	}

}
